function showGuest(id){
	if(id == null){
		if($("[name=maxEntries]").val() == null){
			var line = 10;
		}else{
			var line = $("[name=maxEntries]").val();
		}
		if($("[name=selectpage]").val() == null){
			var pagePointer = 1; 
		}else{
			var pagePointer = $("[name=selectpage]").val(); 
		}
	}else if(id == "next"){
		var line = $("[name=maxEntries]").val();
		var pagePointer = parseInt($("[name=selectpage]").val())+1;
	}else if(id == "previous"){
		var line = $("[name=maxEntries]").val();
		var pagePointer = parseInt($("[name=selectpage]").val())-1;		
	}
	var link = "/guestService";
	var data = { func: "GetAllGuest4Admin",
				offset: (line*pagePointer)-line,
				line: line,
				pagePointer: pagePointer
					}
	simpleservice(link,data,showGuestList);
}

function showGuestList(data){
	var objArray2 = new Array();
	objArray2 = JSON.parse(data);
	var checkLogOut = CheckSession(objArray2);
	if(checkLogOut)
		return;
	
	var sumtext = "";
	var text = "";
	var pageAmount = objArray2["pageAmount"];
	var line = objArray2["lineAmount"];
	var pagePointer = objArray2["pageNumber"];
	var objArray = objArray2["data"];
	$("#listsize").html("&nbsp;("+objArray2["dataAmount"]+")");
	var lineNumber = (line * pagePointer) - (line-1) ;
	
	if(objArray.length == 0){
		text = "<tr><td colspan=\"11\" style=\"border-top:1px #D6D7D5 solid;border-bottom:1px #D6D7D5 solid;\">"+nodata+"</td></tr>";
		sumtext += text;
	}else{
		for(var i = 0;i< objArray.length+1;i++){
				if(i != objArray.length ){
					var lastName = (objArray[i]["guest"]['lastName'] == "")?"":objArray[i]["guest"]['lastName'];
					text = "<tr id=\"row_"+objArray[i]["guest"]['id']+"\" style=\"border: 0px;\"> " +
							"<td id=\"col_1\" align=\"center\"> "+(lineNumber+i)+". </td>"+
							"<td><input type=\"checkbox\" id=\"id_"+i+"\" name=\"ids[]\" value=\""+objArray[i]["guest"]['id']+"\"> </td>"+
							"<td align=\"left\"> P"+objArray[i]["guest"]['id']+" </td>"+
							"<td align=\"left\"> <span class=\"link\" onclick=\"showGuestInfoDialog($(this),"+objArray[i]["guest"]['id']+")\">"+objArray[i]["guest"]['firstName']+" "+lastName+"</span> </td>"+
							"<td align=\"left\"> "+objArray[i]["guest"]['country']+" </td>"+
							"<td align=\"left\"> "+objArray[i]["guest"]['mail']+" </td>"+
							"<td align=\"left\"> "+objArray[i]["guest"]['phone']+" </td>"+
							"<td align=\"left\"> "+objArray[i]["guest"]['company']+" </td>"+
							"<td align=\"center\"><a href=\"#\" onclick=\"ShowManageGuestDialog("+objArray[i]["guest"]['id']+")\">Edit</a></td>"+
							"<td align=\"center\"><a href=\"#\" onclick=\"changeStatus("+objArray[i]["guest"]['id']+") \"> " +
							"<span id =status"+objArray[i]["guest"]['id']+">"+objArray[i]['status']+"</a>" +
							"</td>" +
							"<td align=\"center\">Send E-mail</td>"+
							"</tr>";
					sumtext += text;
				}else{
					text = "<tr>"+
					"<td colspan=\"13\" style=\"padding:0;\">"+
					"<table class=\"tablefoot\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">" +
					"<tbody>"+
						"<tr>"+
							"<td width=\"33%\" align=\"left\">"+foor_page+"&nbsp;"+
								"<select name=\"selectpage\" onchange=\"showGuest()\">"+
								"</select>&nbsp;"+foor_of+"&nbsp;<span id=\"pageAmount\">1</span>"+
							"</td>"+
							"<td width=\"31%\" align=\"center\">"+foor_view+
								"<select name=\"maxEntries\" onchange=\"showGuest()\">"+
									"<option style=\"color:#000000\"  value=\"10\">10</option>"+
									"<option style=\"color:#000000\"  value=\"20\">20</option>"+
									"<option style=\"color:#000000\"  value=\"50\">50</option>"+
									"<option style=\"color:#000000\"  value=\"100\">100</option>"+
									"<option style=\"color:#000000\"  value=\"100000\">All</option>"+
								"</select>"+foor_rpp+" </td>" +
								"<td width=\"36%\" align=\"right\"><span id=\"previous\">&lt;&lt;"+foor_pre+"</span> |" +
								" <span id=\"next\">"+foor_next+"&gt;&gt;</span></td></tr>"+
								"</tbody></table></td></tr>";
					sumtext += text;
				}
		}
	}
	$("#showList tr").not($("#showList").find('.tablehead').parent()).remove();
	$("#showList").append(sumtext);
	$("#pageAmount").text(pageAmount);
	if(pagePointer+1 <= pageAmount){
		$("#next").attr("onclick","showGuest(id)");
		$("#next").html("<a href=\"#\">"+foor_next+"&gt;&gt;</a>");
	}
	if(pagePointer > 1){
		$("#previous").attr("onclick","showGuest(id)");
		$("#previous").html("<a href=\"#\">&lt;&lt;"+foor_pre+"</a>");
	}
	$("[name=maxEntries]").val(line);
	for ( var i = 0; i < pageAmount; i++) {
		$("[name=selectpage]").append(
				$("<option>").val((i+1)).html((i+1)));
		}
	$("[name=selectpage]").val(pagePointer);
	if($("#loadingScreen").is(":visible")) closeWaitingDialog();
}

function changeStatus(id){
	waitingDialog({});
	var url = "/guestService";
	var data = { func : "changeStatus",
			id : id
		}
	simpleservice(url,data,changeStatusSuccess);
}

function changeStatusSuccess(data){
	var objArray = new Array();
	objArray = JSON.parse(data);
	$("#status"+objArray["guest"]["id"]).text(objArray["status"]);
	if($("#loadingScreen").is(":visible")) closeWaitingDialog();
}

function deleteGuest(){
	waitingDialog({});
	var listCheckBox = "";
	var line = $("[name=maxEntries]").val();
	var pagePointer = $("[name=selectpage]").val();
	for(var i = 0;i<$('tr [type=checkbox]').not($('tr [type=checkbox]').first()).length;i++){
		if($('tr [type=checkbox]').not($('tr [type=checkbox]').first())[i].checked == true){
			listCheckBox += $($('tr [type=checkbox]').not($('tr [type=checkbox]').first())[i]).attr("value")+",";
		}
	}
	if(listCheckBox == ""){
		return false;
	}else{
		var url = "/guestService";
		var data = { func : "delGuest",
				id : listCheckBox.substring(0,listCheckBox.length - 1),
				offset: (line*pagePointer)-line,
				line: line,
				pagePointer: pagePointer
			}
		simpleservice(url,data,showGuestList);
	}
}

function ShowManageGuestDialog(id)
{
		var buttons = [
				{title:"Cancel",style:"text-align:center", callback: function(thisdialog,args){
				thisdialog.dialog("close");
				}},
				{title:"Save",style:"text-align:center", callback: function(thisdialog,args){
					SaveGuestChange(thisdialog,args);
					thisdialog.dialog("close");
				}}
			];
		var msgDialog = customDialog("Edit Guest",$('[name=manage_guest_dialog]').html(),{ width: 1200},buttons,id);
		loadDialogData(msgDialog,id);
}

function loadDialogData(dialog,id){
	var url = "/guestService";
	var data = { func : "getGuestById",
			id : id
		}
	simpleserviceSyn(url,data,fillDialog,dialog);
}

function fillDialog(data,dialog){
	var obj = new Array();
	obj = JSON.parse(data);
	fillDropdown($("[name=manage_guest_salutation]"),obj["sal"],"id","title");
	var array  = JSON.parse('[{"genderValue":"M","genText":"male"},{"genderValue":"F","genText":"female"}]');
	fillDropdown(dialog.find("[name=manage_guest_gender]"),array,"genderValue","genText");
	loadnationalityDropDown(dialog.find("[name=manage_guest_nationality]"));
	dateselectDroupDown(dialog.find('[name=manage_guest_dateborn_date]'));
	monthselectDropdown(dialog.find('[name=manage_guest_dateborn_month]'));
	yearselectDropdown(dialog.find('[name=manage_guest_dateborn_year]'));
	
	print_manageguest_country(dialog.find('[id*=manage_guest_company_country]:last'));
	print_manageguest_country(dialog.find("[id*=manage_guest_country]:last"));
	var t1 = dialog.find("[id*=manage_guest_company_country]:last").val();
	var t2 = dialog.find("[id*=manage_guest_country]:last").val();
	print_state_bydom(dialog.find("[id*=manage_guest_province]"),t2);
	print_state_bydom(dialog.find("[id*=manage_guest_company_province]"),t1);
	fillmanageGuestsData(obj["data"],dialog);
}

function fillmanageGuestsData(obj,dialog)
{
	var Sname="-";
	var name=(obj["firstName"]!=null)?obj["firstName"]:"";
	var lastname=(obj["lastName"]!=null)?obj["lastName"]:"";
	var gender="-";
	var nationality="-";
	var date="1";
	var month="1";
	var year="1930";
	var idcard="";
	var passport="";
	var driverlicense="";
	var socialsnumber="";
	var address="";
	var city="";
	var country="";
	var province="";
	var zipcode="";
	var tel=(obj["phone"]!=null)?obj["phone"]:"";
	var fax="";
	var email="";
	
	var companyname="";
	var companyaddress="";
	var companycity="";
	var companycountry="";
	var companyprovince="";
	var companyzipcode="";
	var companytel="";
	var companyfax="";
	var companyemail="";
	
	var guestnote="";
	var markvip=false;
	var guest = obj;
	if(guest == null){return;}
	Sname=guest.salutationString;
	name =guest.firstName;
	lastname=guest.lastName;
	(guest.gender=="")?gender="-":gender=guest.gender;
	if(guest.birthday != null){
		var dateborn =new Date(guest.birthday).toFormatString("yyyy-MM-dd");
		date = dateborn.split("-")[2];
		month = dateborn.split("-")[1];
		year = dateborn.split("-")[0];
	}
	(guest.nationalityString!= null)?nationality=guest.nationalityString:nationality ="-";
	($.isNumeric(guest.idNumber))?idcard=guest.idNumber:idcard="";
	($.isNumeric(guest.passportNumber))?passport=guest.passportNumber:passport="";
	($.isNumeric(guest.driverlicense))?driverlicense=guest.driverlicense:driverlicense="";
	($.isNumeric(guest.socialSecuritycard))?socialsnumber=guest.socialSecuritycard:socialsnumber="";
	address=guest.addressLine1;
	city=guest.city;
	(guest.country!=null)?country=guest.country:country=0;
	(guest.state!=null)?province=guest.state:province=0;
	zipcode=guest.pincode;
	tel=guest.phone;
	fax=guest.fax;
	email=guest.mail;
	companyname=guest.company;
	companyaddress=guest.officeAddress;
	companycity=guest.officeCity;
	companycountry=guest.officeCountry;
	companyprovince=guest.officeState;
	companyzipcode=guest.officePincode;
	companytel=guest.officePhone1;
	companyfax=guest.officeFax;
	companyemail=guest.officeEmail;
	guestnote=guest.note;
	(guest.isVIP!=null)?markvip=guest.isVIP:markvip=false;
	dialog.find("[name=manage_guest_salutation]").find('option[value='+Sname+']').attr('selected','selected');
	dialog.find("[name=manage_guest_name]:visible").val(name);
	dialog.find("[name=manage_guest_lastname]:visible").val(lastname);
	dialog.find("[name=manage_guest_gender]:visible").find('option[value="'+gender+'"]').attr("selected","selected")
	dialog.find("[name=manage_guest_nationality]:visible").find('option[value='+nationality+']').attr('selected','selected');
	dialog.find("[name=manage_guest_dateborn_date]:visible").find('option[value='+date+']').attr('selected','selected');
	dialog.find("[name=manage_guest_dateborn_month]:visible").find('option[value='+month+']').attr('selected','selected');
	dialog.find("[name=manage_guest_dateborn_year]:visible").find('option[value='+year+']').attr('selected','selected');
	dialog.find("[name=manage_guest_idcard]:visible").val(idcard);
	dialog.find("[name=manage_guest_passport]:visible").val(passport);
	dialog.find("[name=manage_guest_driverlicense]:visible").val(driverlicense);
	dialog.find("[name=manage_guest_socialsnumber]:visible").val(socialsnumber);
	dialog.find("[name=manage_guest_address]:visible").val(address);
	dialog.find("[name=manage_guest_city]:visible").val(city);
	dialog.find("[id=manage_guest_country] option:contains(" +country+ ")").attr("selected","selected");
	var t2 = dialog.find("[id*=manage_guest_country]:last").val();
	print_state_bydom(dialog.find("[id*=manage_guest_province]"),t2);
	dialog.find("[id=manage_guest_province]  option:contains(" +province+ ")").attr("selected","selected");
	dialog.find("[name=manage_guest_zipcode]:visible").val(zipcode);
	dialog.find("[name=manage_guest_tel]:visible").val(tel);
	dialog.find("[name=manage_guest_fax]:visible").val(fax);
	dialog.find("[name=manage_guest_email]:visible").val(email);

	dialog.find('[name=manage_guest_company_name]:visible').val(companyname);
	dialog.find('[name=manage_guest_company_address]:visible').val(companyaddress);
	dialog.find('[name=manage_guest_company_city]:visible').val(companycity);
	dialog.find('[id=manage_guest_company_country] option:contains(' +companycountry+ ')').attr('selected','selected');
	var t1 = dialog.find("[id*=manage_guest_company_country]:last").val();
	print_state_bydom(dialog.find("[id*=manage_guest_company_province]"),t1);
	dialog.find('[id=manage_guest_company_province] option:contains(' +companyprovince+ ')').attr('selected','selected');
	dialog.find('[name=manage_guest_company_zipcode]:visible').val(companyzipcode);
	dialog.find('[name=manage_guest_company_tel]:visible').val(companytel);
	dialog.find('[name=manage_guest_company_fax]:visible').val(companyfax);
	dialog.find('[name=manage_guest_company_email]:visible').val(companyemail);
	
	dialog.find('[name=manage_guest_guestnote]').val(guestnote);
	dialog.find('[name=manage_guest_markvip]').attr('checked',markvip);
}

function loadnationalityDropDown(dom)
{
	var states = new Array("Afghan","Albanian","Algerian", "American","Andorran","Angolan","Antiguans",
			"Argentinean", "Armenian", "Australian","Austrian","Azerbaijani","Bahamian", "Bahraini","Bangladeshi",
			"Barbadian", "Barbudans", "Batswana", "Belarusian","Belgian","Belizean","Beninese","Bhutanese", "Bolivian","Bosnian",
			"Brazilian", "British", "Bruneian", "Bulgarian", "Burkinabe","Burmese", "Burundian","Cambodian","Cameroonian",
			"Canadian", "Cape Verdean", "Central African", "Chadian", "Chilean","Chinese", "Colombian", "Comoran", "Congolese",
			"Costa Rican","Croatian", "Cuban","Cypriot","Czech", "Danish", "Djibouti", "Dominican", "Dutch","East Timorese","Ecuadorean",
			"Egyptian", "Emirian","Equatorial Guinean","Eritrean","Estonian", "Ethiopian", "Fijian","Filipino","Finnish",
			"French", "Gabonese", "Gambian","Georgian","German","Ghanaian","Greek","Grenadian", "Guatemalan", "Guinea-Bissauan",
			"Guinean","Guyanese","Haitian","Herzegovinian","Honduran","Hungarian", "I-Kiribati","Icelander", "Indian", "Indonesian",
			"Iranian","Iraqi","Irish","Israeli","Italian","Ivorian","Jamaican","Japanese","Jordanian","Kazakhstani","Kenyan",
			"Kittian and Nevisian", "Kuwaiti","Kyrgyz","Laotian", "Latvian", "Lebanese","Liberian","Libyan", "Liechtensteiner",
			"Lithuanian","Luxembourger","Macedonian", "Malagasy","Malawian","Malaysian","Maldivan", "Malian", "Maltese","Marshallese",
			"Mauritanian","Mauritian","Mexican", "Micronesian","Moldovan", "Monacan","Mongolian","Moroccan","Mosotho","Motswana","Mozambican",
			"Namibian","Nauruan","Nepalese","New Zealander","Nicaraguan","Nigerian","Nigerien","North Korean","Northern Irish",
			"Norwegian","Omani","Pakistani","Palauan","Panamanian","Papua New Guinean","Paraguayan", "Peruvian","Polish",
			"Portuguese","Qatari", "Romanian","Russian","Rwandan","Saint Lucian","Salvadoran", "Samoan", "San Marinese","Sao Tomean",
			"Saudi","Scottish","Senegalese","Serbian","Seychellois", "Sierra Leonean", "Singaporean","Slovakian","Slovenian",
			"Solomon Islander","Somali","South African","South Korean","Spanish","Sri Lankan","Sudanese","Surinamer","Swazi","Swedish",
			"Swiss","Syrian","Taiwanese","Tajik","Tanzanian","Thai","Togolese","Tongan","Trinidadian or Tobagonian","Tunisian",
			"Turkish","Tuvaluan","Ugandan","Ukrainian","Uruguayan","Uzbekistani","Venezuelan","Vietnamese","Welsh","Yemenite",
			"Zambian","Zimbabwean");
	dom.prepend(optionString.format("-",simpleLabel_Select));
	for(var hi=0; hi<states.length; hi++) 
dom.append("<option value=\""+states[hi]+"\">"+states[hi]+"</option>");
}

function dateselectDroupDown(dom)
{
	for(var i=1; i<=31; i++) {
		dom.append("<option value=\""+i+"\">"+i+"</option>");
	}	
}

function monthselectDropdown(dom)
{
	var month = [Month_Short_Jan,Month_Short_Feb,Month_Short_Mar,
				Month_Short_Apr,Month_Short_May,Month_Short_Jun,
				Month_Short_Jul,Month_Short_Aug,Month_Short_Sep,
				Month_Short_Oct,Month_Short_Nov,Month_Short_Dec
				];
	for(var hi=0; hi<month.length; hi++) 
dom.append("<option value=\""+(hi+1)+"\">"+month[hi]+"</option>");
}

function yearselectDropdown(dom)
{
	var date = new Date();
	date.getFullYear();
	for(var hi=1930; hi<=date.getFullYear(); hi++) 
dom.append("<option value=\""+hi+"\">"+(hi+543)+"</option>");
}

function chooseCountry(dom)
{
	if($(dom).attr("id") == "manage_guest_company_country")
	{
		var t1 = $("[id*=manage_guest_company_country]:last").val();
		print_state_bydom($("[id*=manage_guest_company_province]"),t1);
	}
	if($(dom).attr("id")== "manage_guest_country")
	{
		var t2 = $("[id*=manage_guest_country]:last").val();
		print_state_bydom($("[id*=manage_guest_province]"),t2);
		
	}
}

function SaveGuestChange(dialog,id){
	var line = $("[name=maxEntries]").val();
	var pagePointer = $("[name=selectpage]").val();
	var data = { func : "editGuestData",
			offset: (line*pagePointer)-line,
			line: line,
			pagePointer: pagePointer,
			id : id,
			SName:(dialog.find("[name=manage_guest_salutation]").val() !="-")?dialog.find("[name=manage_guest_salutation]").find(':selected').val():0,
			Name:dialog.find("[name=manage_guest_name]").val(),
			lastName:dialog.find("[name=manage_guest_lastname]").val(),
		gender:(dialog.find("[name=manage_guest_gender]").val() !="-")?dialog.find("[name=manage_guest_gender]").val():"",
		nationalityString:dialog.find("[name=manage_guest_nationality]").val(),
		birthday:dialog.find("[name=manage_guest_dateborn_year]").val()+"-"
				+dialog.find("[name=manage_guest_dateborn_month]").val()+"-"
				+dialog.find("[name=manage_guest_dateborn_date]").val(),
		idNumber:dialog.find("[name=manage_guest_idcard]").val(),
		passportNumber:dialog.find("[name=manage_guest_passport]").val(),
		driverlicense:dialog.find("[name=manage_guest_driverlicense]").val(),
		socialSecuritycard:dialog.find("[name=manage_guest_socialsnumber]").val(),
		addressLine:dialog.find("[name=manage_guest_address]").val(),
		city:dialog.find("[name=manage_guest_city]").val(),
		country:(dialog.find("#manage_guest_country").val() !="-")?dialog.find("[id=manage_guest_country]").find(':selected').text():"",
		state:(dialog.find("#manage_guest_province").val() !="-")?dialog.find("[id=manage_guest_province]").find(':selected').text():"",
		pincode:dialog.find("[name=manage_guest_zipcode]").val(),
		phone:dialog.find("[name=manage_guest_tel]").val(),
		fax:dialog.find("[name=manage_guest_fax]").val(),
		mail:dialog.find("[name=manage_guest_email]").val(),
		company:dialog.find('[name=manage_guest_company_name]').val(),
		officeAddress:dialog.find('[name=manage_guest_company_address]').val(),
		officeCity:dialog.find('[name=manage_guest_company_city]').val(),
		officeCountry:(dialog.find("#manage_guest_company_country").val() !="-")?dialog.find("[id=manage_guest_company_country]").find(':selected').text():"",
		officeState:(dialog.find("#manage_guest_company_province").val() !="-")?dialog.find("[id=manage_guest_company_province]").find(':selected').text():"",
		officePincode:dialog.find('[name=manage_guest_company_zipcode]').val(),
		officePhone:dialog.find('[name=manage_guest_company_tel]').val(),
		officeFax:dialog.find('[name=manage_guest_company_fax]').val(),
		officeEmail:dialog.find('[name=manage_guest_company_email]').val(),
		designation:$('[name=manage_guest_company_designation]:visible').val(),
		isVIP:dialog.find('[name=manage_guest_markvip]').is(":checked"),
		isBlackList:false,
		note:dialog.find('[name=manage_guest_guestnote]')[0].value
	};
		var url = "/guestService";
		simpleservice(url,data,showGuestList);
}

function showGuestInfoDialog(dom,id){
	var buttons = [
		       		{ title:"Cancel",style:"text-align:center", callback: function(thisdialog,args){
		       			thisdialog.dialog("close");
		       		}},
		       		{ title:"Edit Guest Info",style:"text-align:center", callback: function(thisdialog,args){
		       			thisdialog.dialog("close");
		       			GoToEditGuestDialog(id);
		       			//if(callback!=null)callback(thisdialog,args);
		       		}}
		       	];
	var dialog = editAdminDataDialog("left,bottom",dom,"Guest Details","/adminconsole/GuestManager/GuestList/guestinfo.jsp","",GoToEditGuestDialog,loadGuestInfoElementFinish,id,buttons);
}

function loadGuestInfoElementFinish(dialog,id){
	dialog.parents(".ui-dialog:first").css("width",800);
	LoadGuestInfo(id,dialog);
}

function GoToEditGuestDialog(id){
	//thisdialog.dialog("close");
	ShowManageGuestDialog(id);
}

function LoadGuestInfo(id,dialog){
	var url = "/guestService";
	var data = { func : "getGuestInFoById",
			id : id
			}
	simpleserviceSyn(url,data,LoadSuccess,dialog);
}

function LoadSuccess(data,dialog){
	var objArray2 = new Array();
	objArray2 = JSON.parse(data);
	var name = objArray2["Name"]+" " +objArray2["SName"];
	if(!objArray2["salutation"] == null || !objArray2["salutation"] == "" ){
		name = objArray2["salutation"] +objArray2["Name"]+" " +objArray2["SName"];
	}
	dialog.find("#guestid").text(objArray2["id"]);
	dialog.find("#name").text(name);
	dialog.find("#gender").text(objArray2["gender"]);
	dialog.find("#birthday").text(new Date(objArray2["birthday"]).getFormatedString());
	dialog.find("#email").text(objArray2["mail"]);
	dialog.find("#idcard").text(objArray2["idNumber"]);
	dialog.find("#passport").text(objArray2["passportNumber"]);
	dialog.find("#driver").text(objArray2["driverlicense"]);
	dialog.find("#ssc").text(objArray2["socialSecuritycard"]);
	dialog.find("#home").text(objArray2["addressLine1"]);
	dialog.find("#zipcode").text(objArray2["pincode"]);
	dialog.find("#phone").text(objArray2["officePhone1"]);
	dialog.find("#fax").text(objArray2["fax"]);
	dialog.find("#mobile").text(objArray2["phone"]);
	dialog.find("#company").text(objArray2["company"]);
	dialog.find("#designation").text(objArray2["designation"]);
	dialog.find("#address").text(objArray2["officeAddress"]);
	dialog.find("#office_zipcode").text(objArray2["officePincode"]);
	dialog.find("#office_phone").text(objArray2["officePhone1"]);
	dialog.find("#office_fax").text(objArray2["officeFax"]);
}
